home *** CD-ROM | disk | FTP | other *** search
- Path: news.rain.org!usenet
- From: "Guus Leeuw jr." <guusl@eiffel.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Dumb Question? about ptr
- Date: Thu, 11 Jan 1996 08:38:31 -0800
- Organization: ISE Inc. http://www.eiffel.com
- Message-ID: <30F53D07.33DC5035@eiffel.com>
- References: <00001a81+00008b8f@msn.com>
- NNTP-Posting-Host: @outback.eiffel.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b3 (X11; I; Linux 1.2.8 i586)
-
- The ugly pink sweater book The Orange book is wrote:
- >
- > Dont laugh im only been programming in this for a few hours but why is
- > this giving me the following errors in Line 11 (I copied straight out
- > o a how to program in C++ book. Yes the compilers match i have
- > Borland C++ 4.02
- >
- > Error NONAME00.CPP 11: Type name expected
- > Error NONAME00.CPP 11: Variable 'foo' is initialized more than once
- > Error NONAME00.CPP 11: Improper use of typedef 'MyStruct'
- >
- >
- > #include <iostream.h>
- >
- > class MyStruct {
- > public:
- > int data;
- > int value;
- > };
- >
- > MyStruct *foo;
- > MyStruct Record1;
- > foo = &MyStruct;
-
- ^^^^^^^^ Guess that this should be Record1, instead.
-
- >
- > void main() {
-
- And this should read: `int main()' (According to ANSI C++ at least)
-
- > foo->data=5;
- > cout << foo->data;
- > };
-
- Regards,
- Guus Leeuw jr.
-